package Io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("Test.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        while (true){
            String data = sc.nextLine();   //将输入的字符串存入data中
            if("exit".equalsIgnoreCase(data)){  //判断
                break;
            }
            osw.write(data);
        }
        osw.close();
    }
}
